//
//  ZWLHomeViewController.m
//  zwlzhibo
//
//  Created by czh on 16/9/9.
//  Copyright © 2016年 czh. All rights reserved.
//

#import "ZWLHomeViewController.h"
#import "ZWLMainViewController.h"
#import "ZWLCaputureVc.h"
#import "ZWLStartLiveVc.h"

@interface ZWLHomeViewController ()

@end

@implementation ZWLHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    [self setupView];
}

- (void)bfBtnClick
{
    ZWLLog(@"点击了播放按钮...");
    ZWLMainViewController *vc = [[ZWLMainViewController alloc] init];
    [self.navigationController pushViewController:vc animated:YES];
}

- (void)capBtnClick
{
//    ZWLLog(@"点击了采集按钮...");
//    ZWLCaputureVc *vc = [[ZWLCaputureVc alloc] init];
//    [self.navigationController pushViewController:vc animated:YES];
    
    ZWLStartLiveVc *liveVc = [[ZWLStartLiveVc alloc] init];
    [self.navigationController pushViewController:liveVc animated:YES];
}

- (void)setupView
{
    /** 播放按钮 */
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"zwl";
    
    UIButton *btn = [[UIButton alloc] init];
    btn.layer.cornerRadius = 5;
    btn.clipsToBounds = YES;
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.center.equalTo(self.view);
        make.width.mas_equalTo(110);
        make.height.mas_equalTo(35);
        
    }];
    [btn setTitle:@"观看直播" forState:UIControlStateNormal];
    btn.backgroundColor = [UIColor purpleColor];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(bfBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *capBtn = [[UIButton alloc] init];
    capBtn.layer.cornerRadius = 5;
    capBtn.clipsToBounds = YES;
    [self.view addSubview:capBtn];
    [capBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.width.equalTo(btn);
        make.height.equalTo(btn);
        make.centerX.equalTo(self.view);
        make.bottom.equalTo(btn).mas_offset(-60);
        
    }];
    [capBtn setTitle:@"开始直播" forState:UIControlStateNormal];
    capBtn.backgroundColor = [UIColor purpleColor];
    [capBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [capBtn addTarget:self action:@selector(capBtnClick) forControlEvents:UIControlEventTouchUpInside];
}

@end
